cmake_minimum_required(VERSION 3.10)

# 添加测试可执行文件
add_executable(test_sm3 test_sm3.c)

# 链接到必要的库
target_link_libraries(test_sm3
    sfts_crypto
    ${GMSSL_LIBRARY}
)

# 包含头文件路径
target_include_directories(test_sm3 PRIVATE
    ${CMAKE_SOURCE_DIR}/include
    ${GMSSL_INCLUDE_DIR}
)

# 添加测试
add_test(NAME test_sm3 COMMAND test_sm3)

# 设置环境变量
set_tests_properties(test_sm3 PROPERTIES
    ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
) 